<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<title>统计分析-</title>
<base href="<%=basePath%>" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit|ie-stand|ie-comp">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="" />
<link rel="stylesheet" href="layui/css/layui.css">
<style type="text/css">

</style>
</head>
<%
	String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
%>
<body data-type="generalComponents">
    <table class="layui-table" id="waterline" lay-filter="waterline">
        <caption style="color:#d71345">水位</caption>
    </table>
    <br>
    <table class="layui-table" id="PlatformProfit" lay-filter="PlatformProfit">
        <caption style="color:#d71345">平台收益</caption>
    </table>
    <br>
    <table class="layui-table" id="zonepump" lay-filter="zonepump">
         <caption style="color:#b2d235;">全服总抽水</caption>
    </table>
    <br>
    <table class="layui-table" id="zonedischargewater" lay-filter="zonedischargewater">
         <caption style="color:#b2d235;">全服总放水</caption>
    </table>
    <br>
    <table class="layui-table" id="bonuspool" lay-filter="bonuspool">
        <caption style="color:#d71345">彩金池</caption>
    </table>
    <br>
    <table class="layui-table" id="Lottery" lay-filter="bonuspool">
        <caption style="color:#d71345">抽彩</caption>
    </table>
    <br>
    <table class="layui-table" id="Playthelottery" lay-filter="bonuspool">
        <caption style="color:#d71345">放彩</caption>
    </table>
    <br>
    <table class="layui-table" id="Platform" lay-filter="Platform">
        <caption style="color:#f47920;">平台发放金币</caption>
    </table>
    <br>
    <table class="layui-table" id="PlayerTotalconsumption" lay-filter="PlayerTotalconsumption">
        <caption style="color:#d71345">玩家总消耗</caption>
    </table>
    <br>

	<script src="js/jquery.min.js"></script>
	<script src="layui/layui.js"></script>
	<script src="js/personal/formsubmit.js"></script>
	
	<script id="AllZoneWaterLinePush" type="text/html">
	    {{# d.AllZoneWaterLinePush = d.ThreeFishingWaterLinePush 
                                   + d.LbjWaterLinePush 
                                   + d.ShzWaterLinePush
                                   + d.DdsWaterLinePush
                                   + d.HBWaterLinePush
                                   + d.LhdWaterLinePush}}
           <span>{{d.AllZoneWaterLinePush}}</span>
        {{# }}
	</script>
	
	<script id="AllZoneWaterLinePull" type="text/html">
	    {{# d.AllZoneWaterLinePull = d.ThreeFishingWaterLinePull 
                                   + d.LbjWaterLinePull 
                                   + d.ShzWaterLinePull
                                   + d.DdsWaterLinePull
                                   + d.HBWaterLinePull
                                   + d.LhdWaterLinePull}}
           <span>{{d.AllZoneWaterLinePull}}</span>
        {{# }}
	</script>
	
	<script id="AllZoneFeeGrab" type="text/html">
	    {{# d.AllZoneFeeGrab = d.ThreeFishingFeeGrab 
                             + d.LbjFeeGrab 
                             + d.ShzFeeGrab
                             + d.DdsFeeGrab 
                             + d.HBFeeGrab
                             + d.LhdFeeGrab}}
           <span>{{d.AllZoneFeeGrab}}</span>
        {{# }}
	</script>
	
	<script id="AllZoneBonus" type="text/html">
	    {{# d.AllZoneBonus = d.LbjBonus}}
           <span>{{d.AllZoneBonus}}</span>
        {{# }}
	</script>
	
	<script id="AllWaterLine" type="text/html">
	    {{# d.AllWaterLine = d.ThreeFishingWaterLine 
                           + d.LbjWaterLine 
                           + d.ShzWaterLine
                           + d.DdsWaterLine 
                           + d.HBWaterLine
                           + d.LhdWaterLine}}
           <span>{{d.AllWaterLine}}</span>
        {{# }}
	</script>
	
	<script>
          layui.use(['layer','table','form'],function(){
        	  var layer = layui.layer,
        	      table = layui.table,
        	      form = layui.form;
        	  
        	var data;
          	$(document).ready(function(){
          		$.ajax({
          			type:"POST",
          			url:'stat/loadStat',
          			data:{kind:"金币"},
          			async:false,
          			success:function(resp){
          				data=JSON.parse(resp);
          			}
          		});
          	});
          	
        	  table.render({
        		  elem:'#Platform',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable1',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'resource_log_reason_gain_shop_recharge',title : '商城充值获得'},
        			  { field : 'resource_log_reason_gain_mail',title : '邮件领取获得'}, 
        			  { field : 'resource_log_reason_gain_relief',title : '领取救济金'},
        			  { field : 'resource_log_reason_gain_daily_recharge',title : '每日充值奖励'},
        			  { field : 'resource_log_reason_gain_vip_lottery',title : 'Vip轮盘抽奖获得'}, 
        			  { field : 'resource_log_reason_gain_welfare_pig_broken',title : '砸金猪奖励'},
        			  { field : 'resource_log_reason_gain_cdkey_code',title : '激活码奖励'},
        			  { field : 'resource_log_reason_gain_first_package',title : '新手起航礼包奖励'},
        			  { field : 'resource_log_reason_fishing_gain_boss_kill',title : '捕鱼世界boss击杀奖励'}
        			  ]],
        			  done:function(res, curr, count){
            				for(var i = 0;i < res.data.length;i++){
            					if(res.data[i].Name != '金币'){
            						$("[lay-id='AllTable1'] tbody tr[data-index=" + i + "]").hide();
            					}
            				}
            		  },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#zonedischargewater',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable2',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'AllZoneWaterLinePush',title : '全服总放水额度',templet:'#AllZoneWaterLinePush'},
        			  { field : 'ThreeFishingWaterLinePush',title : '捕鱼3D放水'}, 
        			  { field : 'LbjWaterLinePush',title : '拉霸机放水'}, 
        			  { field : 'ShzWaterLinePush',title : '水浒传放水'},
        			  { field : 'HBWaterLinePush',title : '抢红包放水'},
        			  { field : 'DdsWaterLinePush',title : '打地鼠放水'},
        			  { field : 'LhdWaterLinePush',title : '龙虎斗放水'}
        			  ]],
        			  done:function(res, curr, count){
          				for(var i = 0;i < res.data.length;i++){
          					if(res.data[i].Name != '金币'){
          						$("[lay-id='AllTable2'] tbody tr[data-index=" + i + "]").hide();
          					}
          				}
          		      },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#zonepump',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable3',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'AllZoneWaterLinePull',title : '全服总抽水额度',templet:'#AllZoneWaterLinePull'},
        			  { field : 'ThreeFishingWaterLinePull',title : '捕鱼3D抽水'}, 
        			  { field : 'LbjWaterLinePull',title : '拉霸机抽水'}, 
        			  { field : 'ShzWaterLinePull',title : '水浒传抽水'},
        			  { field : 'HBWaterLinePull',title : '抢红包抽水'},
        			  { field : 'DdsWaterLinePull',title : '打地鼠抽水'},
        			  { field : 'LhdWaterLinePull',title : '龙虎斗抽水'}
        			  ]],
        			  done:function(res, curr, count){
          				for(var i = 0;i < res.data.length;i++){
          					if(res.data[i].Name != '金币'){
          						$("[lay-id='AllTable3'] tbody tr[data-index=" + i + "]").hide();
          					}
          				}
          		      },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#PlayerTotalconsumption',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable4',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'resource_log_reason_cost_vip_lottery',title : 'vip轮盘抽奖消耗'}
        			  ]],
        		  done:function(res, curr, count){
          				for(var i = 0;i < res.data.length;i++){
          					if(res.data[i].Name != '金币'){
          						$("[lay-id='AllTable4'] tbody tr[data-index=" + i + "]").hide();
          					}
          				}
          		  },
        		  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#PlatformProfit',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable5',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'AllZoneFeeGrab',title : '全服平台收益',templet:'#AllZoneFeeGrab'},
        			  { field : 'ThreeFishingFeeGrab',title : '捕鱼3D平台收益'}, 
        			  { field : 'LbjFeeGrab',title : '拉霸机平台收益'}, 
        			  { field : 'ShzFeeGrab',title : '水浒传平台收益'},
        			  { field : 'HBFeeGrab',title : '抢红包平台收益'},
        			  { field : 'DdsFeeGrab',title : '打地鼠平台收益'},
        			  { field : 'LhdFeeGrab',title : '龙虎斗平台收益'}
        			  ]],
        		  done:function(res, curr, count){
          				for(var i = 0;i < res.data.length;i++){
          					if(res.data[i].Name != '金币'){
          						$("[lay-id='AllTable5'] tbody tr[data-index=" + i + "]").hide();
          					}
          				}
          		  },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#bonuspool',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable6',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'AllZoneBonus',title : '彩金池',templet:'#AllZoneBonus'},
        			  { field : 'LbjBonus',title : '拉霸机彩金池'}
        			  ]],
       			  done:function(res, curr, count){
         				for(var i = 0;i < res.data.length;i++){
         					if(res.data[i].Name != '金币'){
         						$("[lay-id='AllTable6'] tbody tr[data-index=" + i + "]").hide();
         					}
         				}
          		  },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#Lottery',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable7',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'LbjBonusPull',title : '总抽采'},
        			  { field : 'LbjBonusPull',title : '拉霸机抽采'}
        			  ]],
       			  done:function(res, curr, count){
       				for(var i = 0;i < res.data.length;i++){
       					if(res.data[i].Name != '金币'){
       						$("[lay-id='AllTable7'] tbody tr[data-index=" + i + "]").hide();
       					}
       				}
          		  },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#Playthelottery',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable8',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'LbjBonusPull',title : '总放彩'},
        			  { field : 'LbjBonusPull',title : '拉霸机放彩'}
        			  ]],
       			  done:function(res, curr, count){
	       				for(var i = 0;i < res.data.length;i++){
	       					if(res.data[i].Name != '金币'){
	       						$("[lay-id='AllTable8'] tbody tr[data-index=" + i + "]").hide();
	       					}
	       				}
          		  },
        			  data:data.data
        	  });
        	  
        	  table.render({
        		  elem:'#waterline',
        		  method : 'post',
        		  totalRow:true,
        		  cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        		  id:'AllTable9',
        		  cols:[[
        			  { field : 'Name',title : '名称',hide:true},
        			  { field : 'AllWaterLine',title : '全服水位',templet:'#AllWaterLine'},
        			  { field : 'ThreeFishingWaterLine',title : '捕鱼3D水位'},
        			  { field : 'LbjWaterLine',title : '拉霸机水位'},
        			  { field : 'ShzWaterLine',title : '水浒传水位'},
        			  { field : 'HBWaterLine',title : '抢红包水位'},
        			  { field : 'DdsWaterLine',title : '打地鼠水位'},
        			  { field : 'LhdWaterLine',title : '龙虎斗水位'}
        			  ]],
       			  done:function(res, curr, count){
         				for(var i = 0;i < res.data.length;i++){
         					if(res.data[i].Name != '金币'){
         						$("[lay-id='AllTable9'] tbody tr[data-index=" + i + "]").hide();
         					}
         				}
          		  },
        			  data:data.data
        	  });
        	  
        	  setInterval(function(){
        		  $.ajax({
          			type:"POST",
          			url:'stat/loadStat',
          			data:{kind:"金币"},
          			async:false,
          			success:function(resp){
          				data=JSON.parse(resp);
          				setTimeout(function(){
          					table.reload('AllTable1', {data:data.data});
          	              	table.reload('AllTable2', {data:data.data});
          	              	table.reload('AllTable3', {data:data.data});
          	              	table.reload('AllTable4', {data:data.data});
          	              	table.reload('AllTable5', {data:data.data});
          	              	table.reload('AllTable6', {data:data.data});
          	              	table.reload('AllTable7', {data:data.data});
          	              	table.reload('AllTable8', {data:data.data});
          	              	table.reload('AllTable9', {data:data.data});
          				},1000);
          			}
          		});
              },10000);
          });
    </script>

</body>

</html>